package Data;

import java.util.List;

import Logic.Settings;
import Util.MiscUtil;

/**
 * A class that represents a single character from the DB.
 */
public class Character 
{
	private int id;
	private String name;
	private List<String> power;
	private List<String> species;
	private List<String> universe;
	private List<String> rank;
	private float weight;
	private float height;
	private String photoUrl;
	private String gender;
	private List<String> medicalCondition;
	private List<String> occupation;
	private int health = Settings.getMaxCharacterHealth();
	private boolean dead = false;
	
	/**
	 * Constructs a new character.
	 * 
	 * @param id The ID of the character
	 * @param name The name of the character
	 * @param power A list of powers the character has
	 * @param species A list of species the character belongs to
	 * @param universe A list of universes the character belongs to
	 * @param rank A list of ranks with which the character is associated
	 * @param weight The weight of the character, in kilograms
	 * @param height The height of the character, in meters
	 * @param photoUrl A URL of a photo of the character
	 * @param gender The gender of the character
	 * @param medicalCondition The character's list of mediacl conditions
	 * @param occupation Character's occupations
	 */
	public Character(int id, String name, List<String> power, List<String> species, 
			List<String> universe, List<String> rank, float weight, float height, String photoUrl, 
			String gender, List<String> medicalCondition, List<String> occupation)
	{
		this.id = id;
		this.name = MiscUtil.safeString(name);
		this.power = MiscUtil.safeList(power);
		this.species = MiscUtil.safeList(species);
		this.universe = MiscUtil.safeList(universe);
		this.rank = MiscUtil.safeList(rank);
		this.weight = weight;
		this.height = height;
		this.photoUrl = MiscUtil.safeString(photoUrl);
		this.gender = MiscUtil.safeString(gender);
		this.medicalCondition = MiscUtil.safeList(medicalCondition);
		this.occupation = MiscUtil.safeList(occupation);
	}
	
    public int getId() 
    {
        return id;
    }
    
    public void setId(int id) 
    {
        this.id = id;
    }
	
    public String getName() 
    {
        return name;
    }

    public List<String> getPower() 
    {
        return power;
    }

    public List<String> getSpecies() 
    {
        return species;
    }
    
    public List<String> getUniverse() 
    {
        return universe;
    }
    
    public List<String> getRank() 
    {
        return rank;
    }
    
    public float getWeight() 
    {
        return weight;
    }       
    
    public float getHeight() 
    {
        return height;
    }
    
    public String getPhotoUrl() 
    {
        return photoUrl;
    }
    
    public String getGender() 
    {
        return gender;
    }       
    
    public List<String> getMedicalCondition() 
    {
        return medicalCondition;
    }
    
    public List<String> getOccupation() 
    {
        return occupation;
    }

    public int getHealth() 
    {
        return health;
    }
    
    public void setHealth(int health) 
    {
        this.health = health;
    }
    
    public boolean isDead() 
    {
        return dead;
    }
    
    public void setIsDead(boolean dead)
    {
    	this.dead = dead;
    }
    
    public void setPhotoUrl(String photoUrl)
    {
    	this.photoUrl = MiscUtil.safeString(photoUrl);
    }
}
